UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GxfUkX3LMsySQ2k3BdiHeJZfn1ymrVU+oq9KwF6vUcM='
WHERE
key_id = '077900e06458304aecec86c769320f9d74b52d96d92dc997dc543477dd2d41b2'
AND (
token = 'GxfUkX3LMsySQ2k3BdiHeJZfn1ymrVU+oq9KwF6vUcM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)