UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QnUdNQBBmjyH+vIwf36tr8b+tXi/8mvqjDYNfKItaxo='
WHERE
key_id = '72022d3715c0c219225e940f13e037c8d985600b840abcbcc78b7259fa73e8c2'
AND (
token = 'QnUdNQBBmjyH+vIwf36tr8b+tXi/8mvqjDYNfKItaxo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)