UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Vmxzcjg9DQpfOdJ3FFZVm30Xl92d0A3CdJASRa0e/Nw='
WHERE
key_id = 'e1194f96d9b891b3d98b97df237ea5877b94f22e7487da0919b99299749a7fb8'
AND (
token = 'Vmxzcjg9DQpfOdJ3FFZVm30Xl92d0A3CdJASRa0e/Nw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)