UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eQ2RKi+jSixVoQG9jQvI04FjoUp9+jqDk0MtuCAzHiQ='
WHERE
key_id = '43a8acd0b31e51ee22247d40a63454e6786a1c849073a988ce8382706c53c4f6'
AND (
token = 'eQ2RKi+jSixVoQG9jQvI04FjoUp9+jqDk0MtuCAzHiQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)