UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ye59m7p4bNrK+5PEceEbqtONqnF+SrG2dprvz/r68Ck='
WHERE
key_id = '597b002bea11fa63a0f1bce827cab56491a85846c104263158c54f6dde3ec471'
AND (
token = 'Ye59m7p4bNrK+5PEceEbqtONqnF+SrG2dprvz/r68Ck='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)