UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vM+e44IjjQdDjo5PY1TYJmA5WwKIGDHFk+mxdthj0KI='
WHERE
key_id = '851f9e3d753062b6a7f23fa28fd66e03c71827cdc8286305fd970d0e7f0ed21f'
AND (
token = 'vM+e44IjjQdDjo5PY1TYJmA5WwKIGDHFk+mxdthj0KI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)