UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WcziAkZdmZre3bAnoMTuZsGEOt56VRbR71r3PGrxhkY='
WHERE
key_id = '072ffe332ecaec7fe9fa6fa8b03374facb111f8eb259fb2932837670141ca47f'
AND (
token = 'WcziAkZdmZre3bAnoMTuZsGEOt56VRbR71r3PGrxhkY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)