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

Query time 0.00030