UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Pqlht7kL2MWsyofUyUC0FwysjwWdLMf1atauM32ScTg=' 
WHERE 
  key_id = 'f2d63c084e8c3a3d3a485649f3403ba92a28c66a4165eb045dd76c9f06531e0c' 
  AND (
    token = 'Pqlht7kL2MWsyofUyUC0FwysjwWdLMf1atauM32ScTg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045