UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uOcuB7+sYJZK4ciWBMLb9CEsCGjCs4I6qfZTzNjXZOM='
WHERE
key_id = '03155ec6278215cd2589dc0fa2057b4887d8afda3f7f6e05e43c8a9d998c362a'
AND (
token = 'uOcuB7+sYJZK4ciWBMLb9CEsCGjCs4I6qfZTzNjXZOM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)