UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JdQ+uMpZx48/5LSnmBock/8aQ25hxI1+CjLYzXEisRw='
WHERE
key_id = 'b10d0fa68134d6c1093c2bcc56f9bafa81b87af3bf9cacf8abc72f92a9e98993'
AND (
token = 'JdQ+uMpZx48/5LSnmBock/8aQ25hxI1+CjLYzXEisRw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)