UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OdlZQz76caFDc6VSJXRg7fNRuCZN03Sb0eoJOU4jRLI=' 
WHERE 
  key_id = '8dc07e363f0cd08eb8a6e3350476fe0acfa326b07ebb6310dd8e2535cafa0448' 
  AND (
    token = 'OdlZQz76caFDc6VSJXRg7fNRuCZN03Sb0eoJOU4jRLI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031