UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QIlmKlKo5GNDXZ8xVYX2ItqVJlLRCUDX+nCM/3XvAkk=' 
WHERE 
  key_id = 'c3a205e60a82ebdca10711397de56a43dfb4764ef141602d8930bad5bbdd8b4a' 
  AND (
    token = 'QIlmKlKo5GNDXZ8xVYX2ItqVJlLRCUDX+nCM/3XvAkk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054