UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8YcxeC7Lmxx1NJWUrF5KUTuk1QsAliaIc7SufEOf/N8='
WHERE
key_id = 'dc01d0adfcb4337d06ab42d49cb87a6b4f26a4f793b3a41003c16f8c5676c93d'
AND (
token = '8YcxeC7Lmxx1NJWUrF5KUTuk1QsAliaIc7SufEOf/N8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)