UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5Dr4FLB3hg25CdxC9kJv7Y5KBzPf4fmWHF+GJGKeDwA='
WHERE
key_id = 'ebed87d61dda5849afe4dfd19e6c4b857dc7d19651964e1897c5ca8b2b9959f2'
AND (
token = '5Dr4FLB3hg25CdxC9kJv7Y5KBzPf4fmWHF+GJGKeDwA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)