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

Query time 0.00032