UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5anRvW8IaoIFDvUMDAOLYXW4OWvxe1XZy1wom1ORryI=' 
WHERE 
  key_id = '6e3f71862271feeccf124967a25797624dd7ff233fb6f5c816f69017f5ac71d9' 
  AND (
    token = '5anRvW8IaoIFDvUMDAOLYXW4OWvxe1XZy1wom1ORryI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032