UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9q/L0hYF6F1Sk5zs5IYnaNlJFh7Z7G9XuuXik9kT4OU=' 
WHERE 
  key_id = '1e504b8dd2ee0883f277c61a182efbb09ac09997228fba10595ca65290efb2cf' 
  AND (
    token = '9q/L0hYF6F1Sk5zs5IYnaNlJFh7Z7G9XuuXik9kT4OU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041