UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vhu8TKgKz0wGR6eKrvRUgQWhZ3zBPIlT0C2KMiGGoos=' 
WHERE 
  key_id = 'ce74595ca502dc3f3b8d46b824750b086a8f365318fb5ebb13d363a95f939702' 
  AND (
    token = 'vhu8TKgKz0wGR6eKrvRUgQWhZ3zBPIlT0C2KMiGGoos=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047