UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xZoOKj7X7iTaK3+b8x1OWV18Hz1xxoFOp9GECsO3OVU='
WHERE
key_id = 'bfa1ad49053fcfeb307934ebb284bcf235927c03db8b9b88d4dc657f30a48995'
AND (
token = 'xZoOKj7X7iTaK3+b8x1OWV18Hz1xxoFOp9GECsO3OVU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)