UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jviClo1WeER6KJft4D+M2KP1T7oU+lUUaLAIc1O3SKw=' 
WHERE 
  key_id = 'e66be878f6673e741d54100cdd23d4e860ee26dd3de2dc734d7cc2d2cd70d295' 
  AND (
    token = 'jviClo1WeER6KJft4D+M2KP1T7oU+lUUaLAIc1O3SKw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022