UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EeGRovaqnvw2nWF0bD+o4fAAX7rvhx6k/F1JDWFEerA='
WHERE
key_id = 'fb40648704528d9aaf4a7b05ea0bba863cd4619472af7ebc13c11e0178a8dc00'
AND (
token = 'EeGRovaqnvw2nWF0bD+o4fAAX7rvhx6k/F1JDWFEerA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)