UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xyNYX0AFU0wrhpG4VsCShXNCs0omGssEx4ahqltbXGQ='
WHERE
key_id = '28b01bf2db88b5c0fd0f58f7dedd6a0c3109bc8d52fcc3166ad782aa336e285f'
AND (
token = 'xyNYX0AFU0wrhpG4VsCShXNCs0omGssEx4ahqltbXGQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)