UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mQI7Os1WDyD2nnyK5CN/owkVflJinndXIZ1cjm38YXU=' 
WHERE 
  key_id = 'a114b6c7515a03e11f9a8c02710a13bfbcf6b4e6ee7712889380b881292f5cf8' 
  AND (
    token = 'mQI7Os1WDyD2nnyK5CN/owkVflJinndXIZ1cjm38YXU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035