UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zoJ6GkwIJaPnswwruTmukuzkrRvlgkPApix6TBKe8YE='
WHERE
key_id = 'c7f2c85b78fc98d289349c8cc108e708745867f0f20fc1dcafced3b3a43d9d4b'
AND (
token = 'zoJ6GkwIJaPnswwruTmukuzkrRvlgkPApix6TBKe8YE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)