UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2xP/1QbuaI62wjHpNVGPsTJ1plpiYJ8zMm9+inMTTTw=' 
WHERE 
  key_id = 'db4b084075ad43e9db3bee27d762777ac2aef509443c47484c0ce098aed1a635' 
  AND (
    token = '2xP/1QbuaI62wjHpNVGPsTJ1plpiYJ8zMm9+inMTTTw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035