UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CLrWjbI/bFiZjRVplgs1QnmUOdYzV+rbl9ZslX/Jh9s='
WHERE
key_id = '9a65fa7c40ac1d31fb202616c6fec6841d8c5ca14dc58b5200ad753f11af85dc'
AND (
token = 'CLrWjbI/bFiZjRVplgs1QnmUOdYzV+rbl9ZslX/Jh9s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)