UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SQ3zpfeZgo4N067tJjHdyTYbBgw/8Ua1O9yvHK3QatE='
WHERE
key_id = 'd15417839a2f121e159c981520311ca1ede6cd663655a8b6c5550defb93279da'
AND (
token = 'SQ3zpfeZgo4N067tJjHdyTYbBgw/8Ua1O9yvHK3QatE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)