UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OkQLQOMg8mFJ6+L86wlVNqGdFkMc/sjvDwZ8acmjmGA=' 
WHERE 
  key_id = 'f103cc3deb76f560eadd2d8a47941747f1efd24f38d92fc6077b852ada523414' 
  AND (
    token = 'OkQLQOMg8mFJ6+L86wlVNqGdFkMc/sjvDwZ8acmjmGA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049