UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'exUskjCVroroODzDTEH4epfLYm9YKC8guf7UnfMUwCU=' 
WHERE 
  key_id = '72a86117e03766894be54e182c53508edbaa78cebe7d5fc237c69c78f4acf098' 
  AND (
    token = 'exUskjCVroroODzDTEH4epfLYm9YKC8guf7UnfMUwCU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041