UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HZlvfCEuW17I5QjAku92r5O3wwODrejkNUvsbmMq7Yo='
WHERE
key_id = '6a28d9989aac82844ba1298aa5ebc5ff423c8b30804fc2497289120ae780959c'
AND (
token = 'HZlvfCEuW17I5QjAku92r5O3wwODrejkNUvsbmMq7Yo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)