UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MmyIxILNq9jHVFv4qRSIgnFH+hc67LK6jtO7DNC7zpo='
WHERE
key_id = '8d36126e965d0e6358cd1a8d3c1d36422fe08452d6e0782b9003764a3346466c'
AND (
token = 'MmyIxILNq9jHVFv4qRSIgnFH+hc67LK6jtO7DNC7zpo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)