UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dFCSNCfbRiNgixdLYzSPUK4Y2/+pCAmH7PqFwQgY07w='
WHERE
key_id = '79a4d3a9c79672ffa9f9f2160c8ad84e864e990db21a3cea0c077500208623a3'
AND (
token = 'dFCSNCfbRiNgixdLYzSPUK4Y2/+pCAmH7PqFwQgY07w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)