UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JRUIPgyRRUIyLsOM/4/rBsfO8byKcV9vuaJ885u7eHU=' 
WHERE 
  key_id = 'c2e9db683bff78990b63798955a4b86a8c1716975fd76f3f6cdc48af8c84ab19' 
  AND (
    token = 'JRUIPgyRRUIyLsOM/4/rBsfO8byKcV9vuaJ885u7eHU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047