UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1yFmjV4KvyDnQDVKZfTwGdHfqcTcWEBzl6LmxUm5bOc=' 
WHERE 
  key_id = 'c61b815ce3022db4a58092c86980aed9491f418ffc8cc42afe7f77eb28f2d7e7' 
  AND (
    token = '1yFmjV4KvyDnQDVKZfTwGdHfqcTcWEBzl6LmxUm5bOc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019