UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xCGft/+5s2ghvoGZgT8FRabzN4zxWgP2NPjdB8DJSnE='
WHERE
key_id = '97a1f43f59517a0d772bf9e38646f1d73c32dfa20ad0268ccdfd29042d8d9a83'
AND (
token = 'xCGft/+5s2ghvoGZgT8FRabzN4zxWgP2NPjdB8DJSnE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)