UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'y4RIQhuzcWXIzlthaEyGGrqeI0MXQs1ZxocDdrp4T4o='
WHERE
key_id = 'c4e3812f9de6c9f44c5e1e3db8eda727fde2ac1d8c1860af4788052ce8430b74'
AND (
token = 'y4RIQhuzcWXIzlthaEyGGrqeI0MXQs1ZxocDdrp4T4o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)