UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oibsW+fdCBVhy6yMr7Mg7ITsVZ2KQjKN6MM8HvB1cQI=' 
WHERE 
  key_id = 'b059453078316a1fe37b0901c15361f5a24ac6cf76e6bea79d851918fe63325c' 
  AND (
    token = 'oibsW+fdCBVhy6yMr7Mg7ITsVZ2KQjKN6MM8HvB1cQI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019