UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'U/7I0mV8XL03NFrTNjnNiw07hs41RIKoIyQPGnEGbuk='
WHERE
key_id = 'f5824fe12a3bdad7a46c4fee93f1965b0cf35312db4e05a751b4be0779153439'
AND (
token = 'U/7I0mV8XL03NFrTNjnNiw07hs41RIKoIyQPGnEGbuk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)