UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'r3BtbaXljP/JOUwRT+6/SdEWuJzRIwRb8PBLqTcepVI='
WHERE
key_id = 'fed9b523f491dd3fbaf6e48f6c551289967a9f750fbb5958d77a32db3784c4a4'
AND (
token = 'r3BtbaXljP/JOUwRT+6/SdEWuJzRIwRb8PBLqTcepVI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)