UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IcBS4BfMUxnSQLIYaOIpkXfZBMmJMvYZSwia330Lruk=' 
WHERE 
  key_id = '26a4ce381e754046e132df1ab9f1ef0971ab599bfdb0e8f9801571d0659f48f1' 
  AND (
    token = 'IcBS4BfMUxnSQLIYaOIpkXfZBMmJMvYZSwia330Lruk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037