UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CCPuLlXzVi66E0pPG2fKy5cpfWgKLzOdehwU6k4cnyo='
WHERE
key_id = '237cf0e0c836b359eb4fd58712ad7857c3ceb4aa951fc84499de6a9958b46834'
AND (
token = 'CCPuLlXzVi66E0pPG2fKy5cpfWgKLzOdehwU6k4cnyo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)