UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'idrHQpVctIlEnAgRKFVYe1CQc+VFM9xMRJMj0plFGBE='
WHERE
key_id = '5e89a5be8d0c7bc97ae1fc890301a42a23027d38d7ce208165b323f1a8a5e570'
AND (
token = 'idrHQpVctIlEnAgRKFVYe1CQc+VFM9xMRJMj0plFGBE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)